//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tyr_menu\fn_mouseClick.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_disp","_handled","_button","_button_2"];
_disp = uiNameSpace getVariable [QGVAR(display_ui),displayNull];
_button = _this select 1;
_handled = false;
_button_2 = _button + 65536;
TRACE_1("Mouse",ARR_3(_button,_button_2,actionKeys "Action"));
if (GVAR(is_open)) then {
	if (_button_2 in (actionKeys "Action")) then {
		[] call FUNC(openSelected);
		_handled = true;
	} else {
		[] call FUNC(close);
	};
} else {

};

TRACE_1("End",_handled);
TMFPROFILERSTOP;
_handled
